{% extends "base.html" %}
{% block body %}
      <!-- Main component for a primary marketing message or call to action -->
      <div class="jumbotron">
        {{ summary }}
        	 {% if project_github or project_bitbucket or project_sourceforge or project_website %}
	<p> Find us on&hellip;</p>
        <p>
        	 {% if project_github %}
          <a class="btn btn-lg btn-primary" href="{{ project_github }}" role="button">GitHub</a>
			 {% endif %}
			 {% if project_bitbucket %}
          <a class="btn btn-lg btn-primary" href="{{ project_bitbucket }}" role="button">Bitbucket</a>
			 {% endif %}
			 {% if project_sourceforge %}
          <a class="btn btn-lg btn-primary" href="{{ project_sourceforge }}" role="button">Sourceforge</a>
			 {% endif %}
			 {% if project_website %}
          <a class="btn btn-lg btn-primary" href="{{ project_website }}" role="button">The Web</a>
			 {% endif %}
	         {% endif %}
			 {% if project_download %}
          <a class="btn btn-lg btn-danger" style="float:right" href="{{ project_download }}" role="button">Download the Source</a>
			 {% endif %}
        </p>
      </div>

      <div class="row" id='text'>
		  {% if author %}
        <div class="col-md-8">
		  {% else %}
        <div class="col-md-12">
		  {% endif %}
          <h1>{{ project }}</h1>
          {{ proj_docs }}
        </div>
		  {% if author %}
        <div class="col-md-4">
	  <div class="well">
          <h2>Developer Info</h2>
          <h4>{{ author }}</h4>
          {% if author_pic %}
     		 <img src="{{ author_pic }}" alt="Developer picture" class="img-thumbnail">
    		 {% endif %}
          {{ author_description }}
			   {% if github or bitbucket or facebook or twitter or google_plus or linkedin or email or website %}
            <div class="text-center"><div class="btn-group" role="group">
              {% if email %}
              <a class="btn btn-lg btn-primary" href="mailto:{{ email }}"><i class="fa fa-envelope fa-lg"></i></a>
              {% endif %}
              {% if website %}
             <a class="btn btn-lg btn-primary" href="{{ website }}"><i class="fa fa-globe fa-lg"></i></a>
              {% endif %}
              {% if github %}
              <a class="btn btn-lg btn-primary" href="{{ github }}"><i class="fa fa-github fa-lg"></i></a>
				  {% endif %}
				  {% if bitbucket %}
              <a class="btn btn-lg btn-primary" href="{{ bitbucket }}"><i class="fa fa-bitbucket fa-lg"></i></a>
              {% endif %}
              {% if facebook %}
              <a class="btn btn-lg btn-primary" href="{{ facebook }}"><i class="fa fa-facebook fa-lg"></i></a>
				  {% endif %}
              {% if google_plus %}
              <a class="btn btn-lg btn-primary" href="{{ google_plus }}"><i class="fa fa-google-plus fa-lg"></i></a>
				  {% endif %}
              {% if linkedin %}
              <a class="btn btn-lg btn-primary" href="{{ linkedin }}"><i class="fa fa-linkedin fa-lg"></i></a>
				  {% endif %}
              {% if twitter %}
              <a class="btn btn-lg btn-primary" href="{{ twitter }}"><i class="fa fa-twitter fa-lg"></i></a>
				  {% endif %}
            </div></div>
            {% endif %}
       </div>
       </div>
       {% endif %}
      </div>
      {% set count=1 %}
      {% if project.modules|length > 0 %}{% set count = count + 1 %}{% endif %}
      {% if project.procedures|length > 0 %}{% set count = count + 1 %}{% endif %}
      {% if project.types|length > 0 %}{% set count = count + 1 %}{% endif %}
		{% set width = (12/count)|int %}
      <div class="row">
        <div class="col-xs-6 col-sm-{{ width }}">
              <h3>Source Files</h3>
              <ul>
                {% for src in project.allfiles|sort(attribute='name') %}
                  {% if loop.index0 < 10 %}
                    <li>{{ src }}</li>
                  {% elif loop.index0 == 10 %}
                    <li><a href="{{ project_url }}/lists/files.html"><em>All source files&hellip;</em></a></li>
                  {% endif %}
                {% endfor %}
              </ul>
          </div>
          {% if project.modules|length > 0 %}
		  <div class="col-xs-6 col-sm-{{ width }}">
              <h3>Modules</h3>
              <ul>
                {% for mod in project.modules|sort(attribute='name') %}
                  {% if loop.index0 < 10 %}
                    <li>{{ mod }}</li>
                  {% elif loop.index0 == 10 %}
                    <li><a href="{{ project_url }}/lists/modules.html"><em>All modules&hellip;</em></a></li>
                  {% endif %}
                {% endfor %}
              </ul>
          </div>
          {% endif %}
          {% if project.procedures|length > 0 %}
		  <div class="col-xs-6 col-sm-{{ width }}">
              <h3>Procedures</h3>
              <ul>
                {% for proc in project.procedures|sort(attribute='name') %}
                  {% if loop.index0 < 10 %}
                    <li>{{ proc }}</li>
                  {% elif loop.index0 == 10 %}
                    <li><a href="{{ project_url }}/lists/procedures.html"><em>All procedures&hellip;</em></a></li>
                  {% endif %}
                {% endfor %}
              </ul>
          </div>
          {% endif %}
          {% if project.types|length > 0 %}
		  <div class="col-xs-6 col-sm-{{ width }}">
              <h3>Derived Types</h3>
              <ul>
                {% for dtype in project.types|sort(attribute='name') %}
                  {% if loop.index0 < 10 %}
                    <li>{{ dtype }}</li>
                  {% elif loop.index0 == 10 %}
                    <li><a href="{{ project_url }}/lists/types.html"><em>All derived types&hellip;</em></a></li>
                  {% endif %}
                {% endfor %}
              </ul>
          </div>
          {% endif %}
      </div>
{% endblock body %}

